'use strict'

const {
  TaiSpider,
  ItemLoader
} = require('tai-spider');

class QuotesSpider extends TaiSpider {

  constructor(options = {}) {
    super(options);
    this.name = 'quotes';
    this.debug = true;
    this.start_urls = [
      'https://quotes.toscrape.com/page/1/',
    ];
  }

  * parse(response) {
    for (let ele of response.css('div.quote')) {
      yield {
        'text': response.css('span.text', ele).text(),
      };
    }
  }
}

module.exports = QuotesSpider;